
# 11. 输出 9*9 乘法口诀表。

"""
思路 ：
1. 通过结果找到打印规律 ：  print(x," * ",y," = ",x * y)
"""
for x in range(1,10):
    for y in range(1,x+1):
        print(x, " * ", y, " = ", x * y,end="  ")
    print()


# 12. 输入一行字符，分别统计出其中英文字母、空格、数字和其它字符的个数。
my_str = "jksdfjksldfjsdfsfhjsdjhk76432jh23423ghjh4223 hjkfsf%^&*fsdfsdfd"
char = 0
number = 0
space = 0
other = 0
for x in my_str:
    if x.isalpha():      # 判断是字母
        char += 1
    elif x.isdigit():       #判断的是数字
        number += 1
    elif x.isspace():       # 判断的是空格
        space += 1
    else:
        other += 1
print("字符数量:",char)
print("数字数量:",number)
print("空格数量:",space)
print("其它字符数量:",other)

char = 0
number = 0
space = 0
other = 0
for x in my_str:
    if x.isalpha():      # 判断是字母
        char += 1
        continue
    if x.isdigit():       #判断的是数字
        number += 1
        continue
    if x.isspace():       # 判断的是空格
        space += 1
        continue
    other += 1
print("字符数量:",char)
print("数字数量:",number)
print("空格数量:",space)
print("其它字符数量:",other)

